﻿using Newtonsoft.Json;
using System.Collections.Generic;

namespace Timeline.Beans {
    public class GeneralApi {
        [JsonProperty(PropertyName = "status")]
        public int Status { set; get; }

        [JsonProperty(PropertyName = "msg")]
        public string Msg { set; get; }

        [JsonProperty(PropertyName = "data")]
        public List<GeneralApiData> Data { set; get; }

        [JsonProperty(PropertyName = "extend")]
        public GeneralApiExtend Extend { set; get; }

        [JsonProperty(PropertyName = "auth")]
        public AccountApi Auth { set; get; }
    }

    public class GeneralApiData {
        // ID（不可为null）
        [JsonProperty(PropertyName = "id")]
        public string Id { set; get; }

        // 收录顺序
        [JsonProperty(PropertyName = "no")]
        public int No { set; get; }

        // 收录日期：yyyy-MM-dd
        [JsonProperty(PropertyName = "reldate")]
        public string RelDate { set; get; }

        // 标题
        [JsonProperty(PropertyName = "title")]
        public string Title { set; get; }

        // 故事、标签组（分隔符：“, ”）
        [JsonProperty(PropertyName = "story")]
        public string Story { set; get; }

        // 版权所有、作者、上传者、分享者
        [JsonProperty(PropertyName = "copyright")]
        public string Copyright { set; get; }

        // 版权所有、作者、上传者、分享者
        [JsonProperty(PropertyName = "copyrightrich")]
        public string CopyrightRich { set; get; }

        //// 分类ID
        //[JsonProperty(PropertyName = "cateid")]
        //public string CateId { set; get; }

        //// 分类名
        //[JsonProperty(PropertyName = "catename")]
        //public string CateName { set; get; }

        // 大类ID
        [JsonProperty(PropertyName = "catehowid")]
        public string CateHowId { set; get; }

        // 大类名
        [JsonProperty(PropertyName = "catehowname")]
        public string CateHowName { set; get; }

        // 子类ID
        [JsonProperty(PropertyName = "catewhatid")]
        public string CateWhatId { set; get; }

        // 子类名
        [JsonProperty(PropertyName = "catewhatname")]
        public string CateWhatName { set; get; }

        // 原图源名
        [JsonProperty(PropertyName = "rawprovider")]
        public string RawProvider { set; get; }

        // 原图源图片ID
        [JsonProperty(PropertyName = "rawid")]
        public string RawId { set; get; }

        // 平台发布链接
        [JsonProperty(PropertyName = "srcurl")]
        public string SrcUrl { set; get; }

        // 图片URL（不可为null）
        [JsonProperty(PropertyName = "imgurl")]
        public string ImgUrl { set; get; }

        // 缩略图URL
        [JsonProperty(PropertyName = "thumburl")]
        public string ThumbUrl { set; get; }

        // 热度分
        [JsonProperty(PropertyName = "score")]
        public float Score { set; get; }

        // 热度分变化
        [JsonProperty(PropertyName = "rank")]
        public int Rank { set; get; }

        // 收藏数
        [JsonProperty(PropertyName = "blink")]
        public int Blink { set; get; }

        // 图片宽度
        [JsonProperty(PropertyName = "width")]
        public int Width { set; get; }

        // 图片高度
        [JsonProperty(PropertyName = "height")]
        public int Height { set; get; }

        // 占比最大的色调值，[0, 359)，溢出表示黑白灰，基于HSV（HSB）颜色空间
        [JsonProperty(PropertyName = "hue")]
        public int Hue { set; get; }

        // 文件大小
        [JsonProperty(PropertyName = "size")]
        public int Size { set; get; }

        // 文件扩展名
        [JsonProperty(PropertyName = "ext")]
        public string Ext { set; get; }

        // 文件MD5（32位）
        [JsonProperty(PropertyName = "md5")]
        public string Md5 { set; get; }
    }

    public class GeneralApiExtend {
        [JsonProperty(PropertyName = "status")]
        public int Status { set; get; }

        [JsonProperty(PropertyName = "msg")]
        public string Msg { set; get; }

        [JsonProperty(PropertyName = "data")]
        public List<GeneralApiData> Data { set; get; }
    }
}